package docmodel;

import java.util.Iterator;
import java.util.LinkedList;

/**
 * Mantiene la lista di Campi di un documento, evita di inserire duplicati
 * @author andrea
 *
 */
public class XDP_Liste 
{
	public LinkedList<FloatingField> listaFloatingFields;
	
	/**
	 * 
	 */
	public XDP_Liste( ) 
	{	
		listaFloatingFields = new LinkedList<FloatingField>();
	}


	public void aggiungi_field(FloatingField field ) 
	{	
		for(FloatingField ff : listaFloatingFields) {	
			if(ff.getId().equals(field.getId())) return; //evita duplicati
		}
		listaFloatingFields.add(field);
		System.out.println("field aggiunto");
	}

	public void stampa_lista()
	{

	
		System.out.println("******************************");
		
		for(FloatingField ff : listaFloatingFields) {	
			System.out.println(ff.getId());	
		}
	
		System.out.println("******************************\n\n");
		return;
	}
	


}
